//
//  WFQiniuManager.h
//  imtMall
//
//  Created by lorin on 15/6/9.
//  Copyright (c) 2015年 IMT. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MGEnumFile.h"

#import <UIKit/UIKit.h>

#pragma mark qiniu
/**
 *  上传文件类型
 */
typedef NS_ENUM(NSUInteger, WF_Upload_File_Type){
    /**
     *  PNG
     */
    WF_Upload_File_Type_PNG = 0,
    /**
     *  JPG
     */
    WF_Upload_File_Type_JPG,
};

/**
 *  上传模块分类
 */
typedef NS_ENUM(NSUInteger, WF_Upload_Model_Type){
    /**
     *  头像
     */
    WF_Upload_Model_Type_Header_Face = 0,
    
    WF_Upload_Model_Type_Product_Review = 1,
    
    WF_Upload_Model_Type_After_Sale = 2
};



//上传七牛结果block
typedef void(^WFQiniuUploadFinshBlock)(BOOL success,NSString *key,NSString *link);
//上传七牛进度block
typedef void (^WFQiniuUploadPercentBlock)(NSString *key,float percent);

//#define WFQiniuManage  ([WFQiniuManager sharedManager])

@interface WFQiniuManager : NSObject
+ (WFQiniuManager *)sharedManager;

/**
 *  上传图片到七牛
 *
 *  @param image        图片
 *  @param fileType     图片类型
 *  @param uploadModel  上传到的模块
 *  @param finishBlock  完成回调
 *  @param percentBlock 上传进度回调
 */
-(void)uploadQNImage:(UIImage *)image
             itemKey:(NSString *)itemKey
            groupKey:(NSString *)gorupKey
         finishBlock:(WFQiniuUploadFinshBlock)finishBlock
        percentBlock:(WFQiniuUploadPercentBlock)percentBlock;

+ (NSString *)createTokenWithScope:(NSString *)scope accessKey:(NSString *)accessKey secretKey:(NSString *)secretKey itemkey:(NSString *)itemkey;
+(NSString *)createGroupKey;
+(NSString *)createitemKey;

@end
